package Arkkomeet

import org.apache.commons.lang.builder.EqualsBuilder
import org.apache.commons.lang.builder.HashCodeBuilder

class ParticipanteXMinuta implements Serializable {

	CatalogoParticipante catPartId
	Minuta minId
	Integer asistencia	

//	int hashCode() {
//		def builder = new HashCodeBuilder()
//		builder.append catPartId
//		builder.append minId
//		builder.toHashCode()
//	}
//
//	boolean equals(other) {
//		if (other == null) return false
//		def builder = new EqualsBuilder()
//		builder.append catPartId, other.catPartId
//		builder.append minId, other.minId
//		builder.isEquals()
//	}

	static belongsTo = [CatalogoParticipante,Minuta]

	static mapping = {		
		table "Participante_X_Minuta"
		catPartId column:"CatPart_ID"
		minId column : "Min_ID"
		asistencia column: "Asistencia"
		id composite: ["catPartId", "minId"]
		version false		
		//a joinTable: [catPart_ID: "CatPart_ID", catPart_Nom:'cat_part_nombre', catPart_Ap1:'cat_part_apellido1', catPart_Ap2:'cat_part_apellido2']
	}

	static constraints = {
		asistencia maxSize: 50
	}
}
